package com.ptu.spzx.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Set;

@Component
public class RefreshTask {
    @Autowired
    private RedisTemplate<String,String> redisTemplate;
    @Scheduled(cron = "0 0 2 * * *")
    public void refreshData() {
        // 在这里执行刷新操作，例如更新Redis中的数据
        // 可以调用相应的服务方法来更新数据
        // redisDataService.updateData();

        System.out.println("定时任务：凌晨2:00刷新数据...");
    }
}
